for bs in 1 4 8 16 32 64 128 192 256
do
    echo "bs: $bs"
    if [ -f "./bert_base_chinese_bs${bs}.om" ]; then
        echo "File ./bert_base_chinese_bs${bs}.om already exists. Skipping..."
    else
        python3 -m onnxsim ./bert_base_chinese.onnx ./bert_base_chinese_bs${bs}.onnx --input-shape "input_ids:${bs},256" "attention_mask:${bs},256" "token_type_ids:${bs},256"
        python3 fix_onnx.py bert_base_chinese_bs${bs}.onnx bert_base_chinese_bs${bs}_fix.onnx
        atc --model=./bert_base_chinese_bs${bs}_fix.onnx --framework=5 --output=./bert_base_chinese_bs${bs} --input_format=ND --log=debug --soc_version=Ascend910B4 --optypelist_for_implmode="Gelu" --op_select_implmode=high_performance
    fi
    # 以bs1模型推理为例
    mkdir -p ./output_data/bs${bs}
    python3 -m ais_bench --model ./bert_base_chinese_bs${bs}.om --input ./input_data/input_ids,./input_data/attention_mask,./input_data/token_type_ids --output ./output_data/ --output_dirname bs${bs} --batchsize ${bs} --device 1
    # 以bs1模型推理为例
    # 输入参数：${result_dir} ${gt_dir} ${seq_length}
    python3 postprocess.py ./output_data/bs${bs} ./input_data/labels 256
done
